package com.gulimall.order.web;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author mayifan
 * @version 1.0
 * @date 2025-02-25 11:57
 */
@Controller
public class HelloController {

    @Autowired
    RabbitTemplate rabbitTemplate;

    @GetMapping("/{page}.html")
    public String listPage(@PathVariable("page") String page){
        return page;
    }

//    @ResponseBody
//    @GetMapping("/testOrder")
//    public String testorder(){
//        OrderEntity orderEntity = new OrderEntity();
//        orderEntity.setId(600l);
//        rabbitTemplate.convertAndSend("order-event-exchange","order.create.order",orderEntity);
//        System.out.println("发送订单...");
//        return "ok";
//    }
}
